package com.ruoyi.common.domain.word.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.domain.word.CommonRa;

import javax.persistence.Column;


/**
 *  @author: bukaa
 *  @Date: 2020-05-08 09:14
 *  @Description: 词根词缀导出实体类
 */
@ContentRowHeight(25)
@HeadRowHeight(30)
@ColumnWidth(30)
public class CommonRaExcelVO {

    @ExcelProperty(value = "序号", index = 0)
    private Long id;

    @ExcelProperty(value = "名称", index = 1)
    private String name;

    @ExcelProperty(value = "释义", index = 2)
    private String ph;

    @ExcelProperty(value = "类型", index = 3)
    private String type;

    @ExcelProperty(value = "单词数量", index = 4)
    @Column(name = "`count`")
    private Integer count;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPh() {
        return ph;
    }

    public void setPh(String ph) {
        this.ph = ph;
    }

    public String getType() {
        if(StringUtils.equals(type, CommonRa.TYPE_PREFIX + "")) {
            return "前缀";
        } else if(StringUtils.equals(type, CommonRa.TYPE_STEM + "" )){
            return "词根";
        } else if(StringUtils.equals(type, CommonRa.TYPE_SUFFIX + "")){
            return "后缀";
        }
        return "其它";
    }

    public void setType(Integer type) {
        this.type = String.valueOf(type);
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public CommonRaExcelVO() {
    }

    public CommonRaExcelVO(String name, String type, Integer count) {
        this.name = name;
        this.type = type;
        this.count = count;
    }

    public CommonRaExcelVO(String name, String type, Integer count, String ph) {
        this.name = name;
        this.type = type;
        this.count = count;
        this.ph = ph;
    }
}